<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<h1>Správa projektů</h1>
<h2>Úprava projektu</h2>

<form:form commandName="project" action="edit" method="post">
	<form:hidden path="id"/>
    <table>
        <tr>
            <td><form:label path="name">Název:</form:label></td>
            <td><form:input path="name" /></td>
            <td><form:errors path="name" cssClass="error" /></td>
        </tr>
        <tr>
            <td><form:label path="description">Popis:</form:label></td>
            <td><form:textarea path="description" /></td>
            <td><form:errors path="description" cssClass="error" /></td>
        </tr>
        <tr>
            <c:if test="${project.repository == null}">
            	<td>Vytvořit repositář:</td>
            	<td><input type="checkbox" name="createRepository" /></td>
            </c:if>
            <c:if test="${project.repository != null}">
            	<td>Repositář:</td>
            	<td><c:out value="${project.repository.url}"></c:out></td>
            </c:if>
            <td></td>
        </tr>
		<tr>
            <td><form:label path="robot">Vyberte robota:</form:label></td>
            <td>
            	<form:select path="robot">
            		<%-- <form:options items="${robots}" /> --%>
            	</form:select>
            </td>
            <td><form:errors path="robot" cssClass="error" /></td>
        </tr>
        <tr>
            <td><form:label path="state">Stav projektu:</form:label></td>
            <td>
            	<form:select path="state">
            		<form:options items="${projectStates}" itemLabel="name" />
            	</form:select>
            </td>
            <td><form:errors path="state" cssClass="error" /></td>
        </tr>
        <tr>
            <td><form:label path="students">Vyberte studenty:</form:label></td>
            <td><%-- <form:checkboxes items="${students}" path=""/> --%></td>
            <td><form:errors path="students" cssClass="error" /></td>
        </tr>
    </table>
    
    <input type="submit" value="Uložit" />
    <a href="list"><input type="button" value="Zrušit" /></a>
</form:form>

</body>
</html>